﻿@model KPIS.GERP.Models.ICM.InventoryStockTakingItem

@{
    Layout = "~/Views/Shared/_EmptyLayout.cshtml";
    
    ViewBag.Title = "แก้ไขรายการตรวจนับพัสดุ";
}    

@using (Html.BeginForm("EditInventoryStockTakingItem", "PurchaseCheckAsset", FormMethod.Post, new { id = "form", @class = "form-horizontal" }))
{
   @Html.AntiForgeryToken()
    <div class="block-button-menu-above">
        @Html.ActionLink("  กลับไปหน้าแสดงข้อมูลทั้งหมด", "IndexInventoryStockTakingItem", new { StockTakingId = ViewBag.StockTakingId }, new { @class = "btn button-standard btn-small icon-reply", role = "button" })
        @Html.ButtonSubmit()
    </div>
    
    @Html.Partial("_EditorInventoryStockTakingItemForm")
    @Html.ValidationSummary(true, KPIS.GERP.Models.Class.ValidateText.RequiredField, new { @class = "alert alert-error" })

    @Html.HiddenFor(model => model.StockTakingId)
    @Html.HiddenFor(model => model.StockTakingItemId)
    @Html.HiddenFor(model => model.ResItemId)
    @Html.HiddenFor(model => model.QuanlityAmountStock)
    @Html.HiddenFor(model => model.CreatedBy)
    @Html.HiddenFor(model => model.CreatedWhen)
    @Html.HiddenFor(model => model.RecordStatus)
}

@section scripts
{
    <script type="text/javascript">

        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({ allow_single_deselect: true });

        $("form").submit(function (e) {
            e.preventDefault();
            var currentForm = this;
            bootbox.confirm(function (result) {
                if (result) {
                    currentForm.submit();
                }
            });
        });

        //Number only
        $("#txtQtyAmountReal").bind('keypress', function (e) {
            return (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57) && (e.which != 46 || $(this).val().indexOf('.') != -1)) ? false : true;
        })
    </script>   
}